#include <bits/stdc++.h>
using namespace std;
int main(){
    int cnt=0;
    int isbn[20];
    for (int i = 0; i < 13; i++)
    {
        if (i==1 || i==5 || i==11)
        {
            getchar();
            continue;
        }
        isbn[cnt]=getchar()-'0';
        cnt++;
    }
    int sum=0;
    for (int i = 1; i < 10; i++)
    {
        sum+=isbn[i-1]*i;
    }
    short result = sum % 11;
    char code=result+'0';
    if (result == 10) code='X';
    if (isbn[9]==10 &&code=='X'||isbn[9]==code-'0') cout<<"Right";
    else
    {
        for (int i = 0; i < 9; i++)
        {
            cout<<isbn[i];
            if (i==0 || i==3) cout<<"-";
        }
        cout<<"-";
        cout<<code;
    }
    
    return 0;
}